package cn.yanceysong.gitstats.model;

import lombok.Data;
import lombok.Builder;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * 每日统计信息
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DailyStats {
    
    /**
     * 提交次数
     */
    private int commitCount;
    
    /**
     * 新增行数
     */
    private int addedLines;
    
    /**
     * 删除行数
     */
    private int deletedLines;
    
    /**
     * 修改行数
     */
    private int modifiedLines;
    
    /**
     * 添加统计信息
     */
    public void addStats(int added, int deleted, int modified) {
        this.addedLines += added;
        this.deletedLines += deleted;
        this.modifiedLines += modified;
    }
    
    /**
     * 增加提交次数
     */
    public void incrementCommitCount() {
        this.commitCount++;
    }
}
